package com.wlz;

import com.sun.net.httpserver.HttpServer;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * wlz
 */
public class WlzServer {


    private Integer port;

    public WlzServer(Integer port) {
        this.port = port;
    }

    public HttpServer create()  throws IOException{
        HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
        server.start();
        System.out.println("启动服务器成功，端口为:"+port);
        return server;

    }
}
